﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;
using System.Reflection;

namespace Common.Extensions.Serialization.Binary
{
    // To Be Continued
    public class ObjectsSerialization : IFormatter
    {
        public SerializationBinder Binder { get; set; }
        public StreamingContext Context { get; set; }
        public ISurrogateSelector SurrogateSelector { get; set; }

        public void Serialize(Stream serializationStream, object graph)
        {
            MemberInfo[] members = FormatterServices.GetSerializableMembers(graph.GetType(), Context);
            object[] objs = FormatterServices.GetObjectData(graph, members);

            BinaryWriter bw = new BinaryWriter(serializationStream);
            Type objtype = null;

            
        }

        public object Deserialize(Stream serializationStream)
        {
            return null;
        }
    }
}
